package com.itheima.app.controller;

import com.itheima.app.service.SetMealService;
import com.itheima.health.model.pojos.Setmeal;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureWebMvc;
import org.springframework.web.bind.annotation.*;
import com.itheima.health.model.common.R;

@RestController
@CrossOrigin
public class SetMealController {
    @Autowired
    private SetMealService setMealService;
    @PostMapping("/setmeal/findById")
    public R setMeal(@RequestParam("id") Long id){
        Setmeal setmeal = setMealService.selectById(id);
        return R.success(setmeal);
    }
    /*
    * 套餐列表展示
    * */
    @GetMapping("/setmeal/getAllSetmeal")
    public R showSetmealList(){
    R r = setMealService.showSetmealList();
    return r;
    }
}
